<template>
  <div class="admin">
    <h1>Welcome to Admin Panel</h1>
    <button @click="logout">Logout</button>
  </div>
</template>

<script>
export default {
  methods: {
    logout() {
      localStorage.removeItem('isAuthenticated') // 清除登录状态
      this.$router.push({ name: 'home' }) // 跳转回首页
    }
  }
}
</script>

<style scoped>
.admin {
  text-align: center;
  padding: 50px;
}
</style>